package main

import (
	"context"
	"google.golang.org/grpc"
	"mxshop/mxshop_srvs/goods_srv/proto"
)

var brandClient proto.GoodsClient
var conn *grpc.ClientConn

func Init() {
	var err error
	conn, err = grpc.Dial("0.0.0.0:61601", grpc.WithInsecure())
	if err != nil {
		panic(err)
	}

	brandClient = proto.NewGoodsClient(conn)
}

func TestGetSubCategory() {
	_, err := brandClient.UpdateGoods(context.Background(), &proto.CreateGoodsInfo{
		Id:     629,
		IsNew:  true,
		IsHot:  true,
		OnSale: true,
	})
	if err != nil {
		panic(err)
	}
}

func main() {
	Init()

	TestGetSubCategory()

	conn.Close()

}
